<template>
  <div class="search-bar">
    <div class="re search-wrap">
      <i class="iconfont icon-ssousuo" />
      <input
        class="search-input"
        @keypress.enter="handleSearch"
        placeholder="搜索科室或医生"
        v-model="inputValue"
      />
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      inputValue: ""
    };
  },
  methods: {
    handleSearch() {
      this.$emit("search", this.inputValue);
    }
  }
};
</script>

<style lang="less" scoped>
.search-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;

.search-wrap{
  background: #f0f0f0;
  margin: 12px 18px;
  border-radius: 20px;
  // border: 1px solid #aaa;
}
  .search-input {
    padding: 8px 10px 8px 40px;
    display: block;
    background: #f0f0f0;
    border:none;
     border-radius: 20px;

  }

  ::-webkit-input-placeholder {
    /* WebKit browsers */
    color: #ababab;
    font-size: 14px;
  }
  .icon-ssousuo {
    position: absolute;
    left: 16px;
    color: #ccc;
  }
  .icon-close {
    color: #ccc;
    position: absolute;
    right: 1em;
    top: 0.3em;
    background: #f0f0f0;
    cursor: pointer;
    display: block;
  }
}
</style>
